<?php

namespace frontend\modules\h5\controllers;

use Yii;
use frontend\components\Controller;
use frontend\modules\h5\models\RecentArticleSearch;
use common\logics\TslineArticleLogic;

/**
 * 泰山号文章相关
 * Default controller for the `h5` module
 */
class TslineController extends Controller {

    public $modelClass = 'frontend\modules\h5\models\ArticleSearch';

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        /* @var $modelClass \api\modules\h5\models\ArticleSearch */
        $modelClass = new $this->modelClass;
        return $modelClass->search();
    }

    /**
     * @inheritdoc
     */
    public function actionRecent($time) {
        /* @var $modelClass \api\modules\h5\models\ArticleSearch */
        $model = new RecentArticleSearch($time);
        return $model->search();
    }

    /**
     * @inheritdoc
     */
    public function actionView($id) {
        return TslineArticleLogic::findOne($id);
    }
    

}
